{
 "cells": [
  {
   "cell_type": "code",
   "id": "initial_id",
   "metadata": {
    "collapsed": true,
    "ExecuteTime": {
     "end_time": "2025-08-03T06:49:44.547043Z",
     "start_time": "2025-08-03T06:49:41.516122Z"
    }
   },
   "source": [
    "from utilities.utilities_func import init_ts\n",
    "import pandas as pd"
   ],
   "outputs": [],
   "execution_count": 1
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-08-03T06:50:14.331467Z",
     "start_time": "2025-08-03T06:50:14.320601Z"
    }
   },
   "cell_type": "code",
   "source": "pro = init_ts()",
   "id": "6215da50b485c769",
   "outputs": [],
   "execution_count": 2
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-08-03T06:53:52.476485Z",
     "start_time": "2025-08-03T06:53:52.235805Z"
    }
   },
   "cell_type": "code",
   "source": [
    "# shibor利率开始于20060101，人民币同业拆借利率（金融机构短期融资成本，用于衡量银行间市场流动性松紧程度）\n",
    "pro.shibor(start_date='20050101', end_date='20051231')"
   ],
   "id": "efee1705270dc4d4",
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Empty DataFrame\n",
       "Columns: [date, on, 1w, 2w, 1m, 3m, 6m, 9m, 1y]\n",
       "Index: []"
      ],
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>date</th>\n",
       "      <th>on</th>\n",
       "      <th>1w</th>\n",
       "      <th>2w</th>\n",
       "      <th>1m</th>\n",
       "      <th>3m</th>\n",
       "      <th>6m</th>\n",
       "      <th>9m</th>\n",
       "      <th>1y</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 9
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-08-03T06:58:22.902656Z",
     "start_time": "2025-08-03T06:58:22.585388Z"
    }
   },
   "cell_type": "code",
   "source": [
    "# 名义GDP数据\n",
    "pro.cn_gdp()"
   ],
   "id": "1bf58830f6b22763",
   "outputs": [
    {
     "data": {
      "text/plain": [
       "    quarter        gdp  gdp_yoy       pi  pi_yoy        si  si_yoy        ti  \\\n",
       "0    2025Q2   660536.0      5.3  31172.0     3.7  239050.0     5.3  390314.0   \n",
       "1    2025Q1   318758.0      5.4  11713.0     3.5  111903.0     5.9  195142.0   \n",
       "2    2024Q4  1349083.5      5.0  91413.9     3.5  492087.1     5.3  765582.5   \n",
       "3    2024Q3   949745.7      4.8  57733.1     3.4  361361.6     5.4  530651.1   \n",
       "4    2024Q2   616836.0      5.0  30660.0     3.5  236529.9     5.8  349646.1   \n",
       "..      ...        ...      ...      ...     ...       ...     ...       ...   \n",
       "169  1956Q4     1028.0     15.0    443.9     4.7     280.7    34.5     303.4   \n",
       "170  1955Q4      910.0      6.8    421.0     7.9     222.2     7.6     266.8   \n",
       "171  1954Q4      859.0      4.2    392.0     1.7     211.7    15.7     255.3   \n",
       "172  1953Q4      824.0     15.6    378.0     1.9     192.5    35.8     253.5   \n",
       "173  1952Q4      679.0      NaN    342.9     NaN     141.8     NaN     194.3   \n",
       "\n",
       "     ti_yoy  \n",
       "0       5.5  \n",
       "1       5.3  \n",
       "2       5.0  \n",
       "3       4.7  \n",
       "4       4.6  \n",
       "..      ...  \n",
       "169    14.1  \n",
       "170     4.6  \n",
       "171    -0.6  \n",
       "172    27.3  \n",
       "173     NaN  \n",
       "\n",
       "[174 rows x 9 columns]"
      ],
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>quarter</th>\n",
       "      <th>gdp</th>\n",
       "      <th>gdp_yoy</th>\n",
       "      <th>pi</th>\n",
       "      <th>pi_yoy</th>\n",
       "      <th>si</th>\n",
       "      <th>si_yoy</th>\n",
       "      <th>ti</th>\n",
       "      <th>ti_yoy</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>2025Q2</td>\n",
       "      <td>660536.0</td>\n",
       "      <td>5.3</td>\n",
       "      <td>31172.0</td>\n",
       "      <td>3.7</td>\n",
       "      <td>239050.0</td>\n",
       "      <td>5.3</td>\n",
       "      <td>390314.0</td>\n",
       "      <td>5.5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2025Q1</td>\n",
       "      <td>318758.0</td>\n",
       "      <td>5.4</td>\n",
       "      <td>11713.0</td>\n",
       "      <td>3.5</td>\n",
       "      <td>111903.0</td>\n",
       "      <td>5.9</td>\n",
       "      <td>195142.0</td>\n",
       "      <td>5.3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2024Q4</td>\n",
       "      <td>1349083.5</td>\n",
       "      <td>5.0</td>\n",
       "      <td>91413.9</td>\n",
       "      <td>3.5</td>\n",
       "      <td>492087.1</td>\n",
       "      <td>5.3</td>\n",
       "      <td>765582.5</td>\n",
       "      <td>5.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>2024Q3</td>\n",
       "      <td>949745.7</td>\n",
       "      <td>4.8</td>\n",
       "      <td>57733.1</td>\n",
       "      <td>3.4</td>\n",
       "      <td>361361.6</td>\n",
       "      <td>5.4</td>\n",
       "      <td>530651.1</td>\n",
       "      <td>4.7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>2024Q2</td>\n",
       "      <td>616836.0</td>\n",
       "      <td>5.0</td>\n",
       "      <td>30660.0</td>\n",
       "      <td>3.5</td>\n",
       "      <td>236529.9</td>\n",
       "      <td>5.8</td>\n",
       "      <td>349646.1</td>\n",
       "      <td>4.6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>169</th>\n",
       "      <td>1956Q4</td>\n",
       "      <td>1028.0</td>\n",
       "      <td>15.0</td>\n",
       "      <td>443.9</td>\n",
       "      <td>4.7</td>\n",
       "      <td>280.7</td>\n",
       "      <td>34.5</td>\n",
       "      <td>303.4</td>\n",
       "      <td>14.1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>170</th>\n",
       "      <td>1955Q4</td>\n",
       "      <td>910.0</td>\n",
       "      <td>6.8</td>\n",
       "      <td>421.0</td>\n",
       "      <td>7.9</td>\n",
       "      <td>222.2</td>\n",
       "      <td>7.6</td>\n",
       "      <td>266.8</td>\n",
       "      <td>4.6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>171</th>\n",
       "      <td>1954Q4</td>\n",
       "      <td>859.0</td>\n",
       "      <td>4.2</td>\n",
       "      <td>392.0</td>\n",
       "      <td>1.7</td>\n",
       "      <td>211.7</td>\n",
       "      <td>15.7</td>\n",
       "      <td>255.3</td>\n",
       "      <td>-0.6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>172</th>\n",
       "      <td>1953Q4</td>\n",
       "      <td>824.0</td>\n",
       "      <td>15.6</td>\n",
       "      <td>378.0</td>\n",
       "      <td>1.9</td>\n",
       "      <td>192.5</td>\n",
       "      <td>35.8</td>\n",
       "      <td>253.5</td>\n",
       "      <td>27.3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>173</th>\n",
       "      <td>1952Q4</td>\n",
       "      <td>679.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>342.9</td>\n",
       "      <td>NaN</td>\n",
       "      <td>141.8</td>\n",
       "      <td>NaN</td>\n",
       "      <td>194.3</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>174 rows × 9 columns</p>\n",
       "</div>"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 10
  },
  {
   "metadata": {},
   "cell_type": "code",
   "outputs": [],
   "execution_count": null,
   "source": "",
   "id": "43c116bfc06a53c4"
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
